#include "VarTableEntry.h"
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

VarTableEntry::VarTableEntry(string name, int entryNo){
	this->name = name;
	this->entryNo = entryNo;
}

bool VarTableEntry::addStmtNumber(int stmtNumber){
	if(find(stmts.begin(),stmts.end(), stmtNumber) != stmts.end()) return false;
	stmts.push_back(stmtNumber);
	return true;
}

bool VarTableEntry::addNodeID(int nodeID){
	if(find(nodeIDs.begin(),nodeIDs.end(),nodeID) != nodeIDs.end()) return false;
	nodeIDs.push_back(nodeID);
	return true;
}

vector<int> VarTableEntry::getStmtNumbers(){
	return stmts;
}

vector<int> VarTableEntry::getNodeIDs(){
	return nodeIDs;
}

string VarTableEntry::getName(){
	return name;
}

int VarTableEntry::getEntryNo(){
	return entryNo;
}
